package shovelsoft.btmetaparser.tokens;

/***
 * Dictionary is a list of pairs of items, mapping the first item in each pair ( usually a Data String ) to the next item.
 * @author cds
 */
public class Dictionary implements IToken {

	/***
	 * Dictionary is a state-less token, only one instance required
	 */
	private static final Dictionary singleton = new Dictionary();
	
	/***
	 * Get access to a Dictionary instance.
	 */
	public static Dictionary getInstance() {
		return singleton;
	}
	
	/***
	 * Private constructor, Dictionary is state-less, see getInstance();
	 */
	private Dictionary() {
	}

	/***
	 * Accept a visit from a token parser (double dispatch)
	 * @param tp Token Parser
	 */
	@Override
	public void accept(ITokenParser tp) throws Exception {
		
		tp.visit(this);
	}
	
	@Override
	public String toString() {
		
		return "DICTIONARY {";
	}
}
